import { contextBridge, ipcRenderer } from 'electron'

contextBridge.exposeInMainWorld('mediaManager', {
  selectFolder: () => ipcRenderer.invoke('select-folder'),
  readMediaFiles: (path, page, pageSize) => 
    ipcRenderer.invoke('read-media-files', path, page, pageSize),
  generateThumbnail: (path) => 
    ipcRenderer.invoke('generate-thumbnail', path),
  moveFiles: (files, targetDir) => 
    ipcRenderer.invoke('move-files', files, targetDir),
  clearThumbnails: () => 
    ipcRenderer.invoke('clear-thumbnails'),
  getSubFolders: (path) => ipcRenderer.invoke('get-sub-folders', path),
  createFolder: (parentPath, name) => 
    ipcRenderer.invoke('create-folder', parentPath, name),
  renameFolder: (path, newName) => 
    ipcRenderer.invoke('rename-folder', path, newName),
  deleteFolder: (path) => 
    ipcRenderer.invoke('delete-folder', path),
  savePaths: (paths) => ipcRenderer.invoke('save-paths', paths),
  getSavedPaths: () => ipcRenderer.invoke('get-saved-paths')
})
